import Vue from 'vue';
import i18n from '@src/locales';

export function useNewVue() {
  function createVue(options: Record<string, any> = {}) {
    return new Vue({
      i18n,
      ...options,
    });
  }

  function extendVue(comp: any, options: Record<string, any> = {}) {
    const instance = Vue.extend(comp);
    return new instance({
      i18n,
      ...options,
    });
  }

  return {
    createVue,
    extendVue,
  };
}
